#include "gtkwidgetpath.h"
+/* GTK_CSS_MATCHER_WIDGET_PATH */
+
static gboolean
gtk_css_matcher_widget_path_get_parent (GtkCssMatcher *matcher,
const GtkCssMatcher *child)
{
- if (child->index == 0)
+ if (child->path.index == 0)
return FALSE;
- matcher->klass = child->klass;
- matcher->path = child->path;
- matcher->state_flags = 0;
- matcher->index = child->index - 1;
- matcher->sibling_index = gtk_widget_path_iter_get_sibling_index (matcher->path, matcher->index);
+ matcher->path.klass = child->path.klass;
+ matcher->path.path = child->path.path;
+ matcher->path.state_flags = 0;
+ matcher->path.index = child->path.index - 1;
+ matcher->path.sibling_index = gtk_widget_path_iter_get_sibling_index (matcher->path.path, matcher->path.index);
return TRUE;
}
gtk_css_matcher_widget_path_get_previous (GtkCssMatcher *matcher,
const GtkCssMatcher *next)
{
- if (next->sibling_index == 0)
+ if (next->path.sibling_index == 0)
return FALSE;
- matcher->klass = next->klass;
- matcher->path = next->path;
- matcher->state_flags = 0;
- matcher->index = next->index;
- matcher->sibling_index = next->sibling_index - 1;
+ matcher->path.klass = next->path.klass;
+ matcher->path.path = next->path.path;
+ matcher->path.state_flags = 0;
+ matcher->path.index = next->path.index;
+ matcher->path.sibling_index = next->path.sibling_index - 1;
return TRUE;
}
static GtkStateFlags
gtk_css_matcher_widget_path_get_state (const GtkCssMatcher *matcher)
{
- return matcher->state_flags;
+ return matcher->path.state_flags;
}
static gboolean
GType type;
type = g_type_from_name (name);
- siblings = gtk_widget_path_iter_get_siblings (matcher->path, matcher->index);
- if (siblings && matcher->sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path, matcher->index))
- return g_type_is_a (gtk_widget_path_iter_get_object_type (siblings, matcher->sibling_index), type);
+ siblings = gtk_widget_path_iter_get_siblings (matcher->path.path, matcher->path.index);
+ if (siblings && matcher->path.sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path.path, matcher->path.index))
+ return g_type_is_a (gtk_widget_path_iter_get_object_type (siblings, matcher->path.sibling_index), type);
else
- return g_type_is_a (gtk_widget_path_iter_get_object_type (matcher->path, matcher->index), type);
+ return g_type_is_a (gtk_widget_path_iter_get_object_type (matcher->path.path, matcher->path.index), type);
}
static gboolean
{
const GtkWidgetPath *siblings;
- siblings = gtk_widget_path_iter_get_siblings (matcher->path, matcher->index);
- if (siblings && matcher->sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path, matcher->index))
- return gtk_widget_path_iter_has_class (siblings, matcher->sibling_index, class_name);
+ siblings = gtk_widget_path_iter_get_siblings (matcher->path.path, matcher->path.index);
+ if (siblings && matcher->path.sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path.path, matcher->path.index))
+ return gtk_widget_path_iter_has_class (siblings, matcher->path.sibling_index, class_name);
else
- return gtk_widget_path_iter_has_class (matcher->path, matcher->index, class_name);
+ return gtk_widget_path_iter_has_class (matcher->path.path, matcher->path.index, class_name);
}
static gboolean
{
const GtkWidgetPath *siblings;
- siblings = gtk_widget_path_iter_get_siblings (matcher->path, matcher->index);
- if (siblings && matcher->sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path, matcher->index))
- return gtk_widget_path_iter_has_name (siblings, matcher->sibling_index, id);
+ siblings = gtk_widget_path_iter_get_siblings (matcher->path.path, matcher->path.index);
+ if (siblings && matcher->path.sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path.path, matcher->path.index))
+ return gtk_widget_path_iter_has_name (siblings, matcher->path.sibling_index, id);
else
- return gtk_widget_path_iter_has_name (matcher->path, matcher->index, id);
+ return gtk_widget_path_iter_has_name (matcher->path.path, matcher->path.index, id);
}
static gboolean
GSList *regions;
gboolean result;
- siblings = gtk_widget_path_iter_get_siblings (matcher->path, matcher->index);
- if (siblings && matcher->sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path, matcher->index))
- regions = gtk_widget_path_iter_list_regions (siblings, matcher->sibling_index);
+ siblings = gtk_widget_path_iter_get_siblings (matcher->path.path, matcher->path.index);
+ if (siblings && matcher->path.sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path.path, matcher->path.index))
+ regions = gtk_widget_path_iter_list_regions (siblings, matcher->path.sibling_index);
else
- regions = gtk_widget_path_iter_list_regions (matcher->path, matcher->index);
+ regions = gtk_widget_path_iter_list_regions (matcher->path.path, matcher->path.index);
result = regions != NULL;
g_slist_free (regions);
const GtkWidgetPath *siblings;
GtkRegionFlags region_flags;
- siblings = gtk_widget_path_iter_get_siblings (matcher->path, matcher->index);
- if (siblings && matcher->sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path, matcher->index))
+ siblings = gtk_widget_path_iter_get_siblings (matcher->path.path, matcher->path.index);
+ if (siblings && matcher->path.sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path.path, matcher->path.index))
{
- if (!gtk_widget_path_iter_has_region (siblings, matcher->sibling_index, region, ®ion_flags))
+ if (!gtk_widget_path_iter_has_region (siblings, matcher->path.sibling_index, region, ®ion_flags))
return FALSE;
}
else
{
- if (!gtk_widget_path_iter_has_region (matcher->path, matcher->index, region, ®ion_flags))
+ if (!gtk_widget_path_iter_has_region (matcher->path.path, matcher->path.index, region, ®ion_flags))
return FALSE;
}
static guint
gtk_css_matcher_widget_path_get_sibling_index (const GtkCssMatcher *matcher)
{
- return matcher->sibling_index;
+ return matcher->path.sibling_index;
}
static guint
{
const GtkWidgetPath *siblings;
- siblings = gtk_widget_path_iter_get_siblings (matcher->path, matcher->index);
+ siblings = gtk_widget_path_iter_get_siblings (matcher->path.path, matcher->path.index);
if (!siblings)
return 0;
const GtkWidgetPath *path,
GtkStateFlags state)
{
- matcher->klass = >K_CSS_MATCHER_WIDGET_PATH;
- matcher->path = path;
- matcher->state_flags = state;
- matcher->index = gtk_widget_path_length (path) - 1;
- matcher->sibling_index = gtk_widget_path_iter_get_sibling_index (path, matcher->index);
+ matcher->path.klass = >K_CSS_MATCHER_WIDGET_PATH;
+ matcher->path.path = path;
+ matcher->path.state_flags = state;
+ matcher->path.index = gtk_widget_path_length (path) - 1;
+ matcher->path.sibling_index = gtk_widget_path_iter_get_sibling_index (path, matcher->path.index);
}